let http = require("http");

// 创建一个服务器
let server = http.createServer((req, res) => {
    console.log(res.url);
    res.writeHead(200, {
        "Content-Type": "text/html;charset=UTF-8"
    });
    res.write("写入一段话")
    res.end("这是首页");
});

// 监听
server.listen(8080);